package com.mtaite.study.mybatis.init;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Arrays;

@Component
public class PostConstructBeanInit {

    @Autowired
    private  Environment environment;


    @PostConstruct
    public void init() {
        //environment实例已初始化
        System.out.println("执行初始化-->PostConstructBeanInit"+Arrays.asList(this.environment.getDefaultProfiles()));
    }
}
